import {
	request,
	hotelRequest,
	otherRequest
} from '@/sheep/request';

export default {

	// 预下单
	hotelBeforehand_zwy: (data) =>
		request({
			url: `zowoyoo/order/calc`,
			method: 'POST',
			data: {
				...data
			}
		}),

	// 商品详情
	detail: (id, params = {}) =>
		otherRequest({
			url: 'goods/goods/' + id,
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),

	detail_zyw: (id, params = {}) =>
		hotelRequest({
			url: 'zowoyoo/goods/' + id,
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),

	// 商品列表
	list: (params) =>
		otherRequest({
			url: 'goods/goods',
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),

	// 商品列表
	list_zyw: (params) =>
		hotelRequest({
			url: 'zowoyoo/goods',
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),




	// 商品查询-原来的
	ids: (params = {}) =>
		otherRequest({
			url: 'goods/goods/ids',
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),
	
	// 商品查询
	ids1: (params = {}) =>
		otherRequest({
			url: 'goods/goods',
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),

	// 商品评价列表
	comment: (id, params = {}) =>
		otherRequest({
			url: 'goods/comment/' + id,
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),
	// 商品评价类型
	getType: (id) =>
		otherRequest({
			url: 'goods/comment/getType/' + id,
			method: 'GET',
			custom: {
				showLoading: false,
				showError: false,
			},
		}),
	// 活动商品查询
	// 商品查询
	activity: (params = {}) =>
		hotelRequest({
			url: 'goods/goods/activity',
			method: 'GET',
			params,
			custom: {
				showLoading: false,
				showError: false,
			},
		}),
	activityList: (params = {}) =>
		hotelRequest({
			url: 'goods/goods/activityList',
			method: 'GET',
			params,
		}),
	// 获取团购海报图
	posterGroup: (params) =>
		otherRequest({
			url: '/group/api/goods/poster',
			method: 'GET',
			params,
		}),
	posterSurpriseShop: (params) =>
		otherRequest({
			url: '/index/shareShop',
			method: 'GET',
			params,
		}),
	// 获取商品海报图
	poster: (params) =>
		otherRequest({
			url: 'goods/goods/poster',
			method: 'GET',
			params,
		}),
	// 酒店新增 ----->
	//首页列表
	hotelData: (params) =>
		request({
			url: 'goods/hotel',
			method: 'GET',
			params
		}),
	//详情
	hotelDateById: (id, params) =>
		request({
			url: `goods/hotel/${id}`,
			method: 'GET',
			params
		}),
	// 酒店评论
	hotelDateByIdComment: (params, id) =>
		request({
			url: `goods/comment/${id}`,
			method: 'GET',
			params,
		}),
	// 房型详情
	hotelDetails: (id) =>
		request({
			url: `goods/hotel/dayDetail/${id}`,
			method: 'GET',
		}),
	// 预下单
	hotelBeforehand: (params) =>
		request({
			url: `hotel/order/pre`,
			method: 'GET',
			params
		}),




	// 入住人列表
	checkinList: () =>
		request({
			url: "/hotel/api/linkman",
			method: 'GET',
		}),
	// 添加入住人
	addCheckin: ( data) =>
		request({
			url: "/hotel/api/linkman",
			method: 'POST',
			data: {
				...data
			}
		}),
	// 修改入住人
	editCheckin: (id, data) =>
		request({
			url: "/hotel/api/linkman/" + id,
			method: 'PUT',
			data: {
				...data
			}
		}),
	// 删除入住人
	deleteCheckin: (id) =>
		request({
			url: "/hotel/api/linkman/" + id,
			method: 'DELETE'
		}),









	// 首页活动列表
	hotelActivity: () =>
		request({
			url: `deploy/list`,
			method: 'GET',
		}),
	//
	hotelCustomList: (params) =>
		request({
			url: `goods/hotel/select`,
			method: 'GET',
			params
		}),
};